/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sistemacontrol;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author wamss
 */
public class ProgramaControl {
               public ProgramaFrame frame;
          public ProgramaControl(ProgramaFrame e)
          {
           
                 this.frame = e;
          }
          public void AceptarButtonActionPerformed()
          {
              String driver = "org.postgresql.Driver";
              String connectString = "jdbc:postgresql://localhost:5432/based2";
              String user="postgres";
              String password ="catec";
          try
         {
               Class.forName(driver);
////               System.out.println("intrucion añadir"); 
               Connection con= DriverManager.getConnection(connectString,user,password);
               CallableStatement proc = con.prepareCall("{call \"setRol\"(?,?)}");
////               proc.registerOutParameter(1,Types.INTEGER);
////               proc.setInt(2,1);
              // proc.setString(1,DescripcionPTextField.getText());
               //proc.setString(2,DescripcionComboBox.getText());
////               proc.setString(3,"AC");
               
               proc.execute();
               proc.close();
               con.close();
         }
        catch(Exception e)
        {
            
               System.out.println(e.getMessage());
        }

              
      
          }
      
    
}
